<template>
  <div class="commont-box" v-if="Object.keys(info).length>0">
    <div class="top-title">
      <div class="title">用户评价</div>
      <div class="more" v-if="info&&info.length > 1">更多</div>
    </div>
    <div class="user-info-box" v-if="info">
      <img :src="info&&info.user&&info.user.avatar" alt="" />
      <div class="username">{{ info&&info.user&&info.user.uname }}</div>
    </div>
    <div class="common-content">
      {{ info&&info.content }}
    </div>
    <div class="timeandproinfo">
      <div class="time">{{ info&&info.created | dateFromat("YYYY-mm-dd") }}</div>
      <div class="time">{{ info&&info.style }}</div>
    </div>
    <div class="imgsBox" v-if="info&&info.images">
      <img :src="item" v-for="(item,index) in info&&info.images" :key="index" alt="" />
    </div>
  </div>
</template>

<script>

import { dateFormat } from 'common/utils'
export default {
  name: "DetailCommontInfo",
  props: ["rate"],
  data() {
    return {
      info: {},
    };
  },
  filters:{
    dateFromat(date,fmt){
      console.log(date)
      return dateFormat(fmt,new Date(date * 1000))
    }
  },
  created() {
    setTimeout(() => {
      this.info = this.rate;
      console.log(this.info);
    }, 1000);
  },
  mounted() {},
  updated() {},
};
</script>

<style scoped>
.commont-box {
  padding: 0 20px;
}
.top-title {
  display: flex;
  height: 50px;
  line-height: 50px;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}
.top-title .title {
  color: #000;
}
.user-info-box {
  display: flex;
  align-items: center;
  padding: 10px 0px;
}
.user-info-box img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid #000;
  margin-right: 15px;
  vertical-align: middle;
}
.timeandproinfo {
  display: flex;
  align-items: center;
  height: 30px;
  line-height: 30px;
  font-size: 14px;
  color: #aaa;
}
.imgsBox {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
}
.imgsBox img {
  width: 85px;
  height: 85px;
  margin-bottom: 10px;
  margin-right: 8px;
}
</style>